package com.matrix.java.chap_06;

import java.util.Scanner;

/*
    显示 0和 1 构成的矩阵
 */
public class Ex6_17 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter n: ");
        int n = input.nextInt();
        input.close();
        printMatrix(n);
    }

    private static void printMatrix(int n) {
        for (int i = 0; i < n; i++) {
            for (int j = 1; j <= n; j++) {
                if (j!=n){
                    System.out.print(Math.round(Math.random())+"\t");
                }else {
                    System.out.println(Math.round(Math.random()));
                }
            }
        }
    }
}
